package com.example.demo.pattern.proxy.staticp;

/**
 * @program: demo
 * @description: 装饰者模式
 * @author: yby
 * @create: 2020-06-23 15:31
 **/
public class DecorateProxy implements ProxyService {

    private BuyHouse buyHouse;

    //和静态代理模式区别： 编译期不知道具体的目标对象，只有运行期调用者手动传入才知道
    public DecorateProxy(BuyHouse buyHouse) {
        this.buyHouse = buyHouse;
    }

    @Override
    public void buyHouse() {
        System.out.println("装饰模式--开始装饰...");
        buyHouse.buyHouse();
        System.out.println("装饰模式--装饰完成...");
    }
}
